//图层管理栏
var layerTreeId = "layertree-main-form";
var layerOperateId = "layertree-main-form" + "-operatebar";
var layerBar = document.createElement("div");
layerBar.className = "layerBar-main-form";
layerBar.id = "layerBar-main-form";
document.body.appendChild(layerBar);
//图层操作栏位置设置
var layerBar_position = document.createElement("div");
layerBar_position.className = "layerBar-main-form-position";
layerBar.appendChild(layerBar_position);

///图层操作
//图层操作容器
var layerbar_data = document.createElement("div");
layerbar_data.className = "layerbar-main-form-data";
layerbar_data.id = "layerbar-main-form-data";
layerbar_data.onclick = function() {
    // var lyId = layerTreeId;
    // var lyTreeList = document.getElementById(lyId);
    // if (!lyTreeList) {
    //     var lyWidget = new LayerTreeWidget(lyId, m_MapConfigLayers);
    //     lyWidget.CreateWidget();
    //     //createWidgetMainForm(lyId)
    //     //show3DLayers(m_LayerInfo);
    // }
    // else {
    //     if (lyTreeList.style.display == "none") {
    //         lyTreeList.style.display = '';
    //         $("#" + layerOperateId).hide();
    //     }
    //     else  
    //         lyTreeList.style.display = 'none';
    // }
    var ztreecontent = document.getElementById("ztreecontent");
    if (ztreecontent.style.display != 'block') {
        ztreecontent.style.display = 'block';
        show3DLayers(m_MapConfigLayers);
    } else {
        var lyTreeLists = document.getElementById("LayerTree-main-form-fixed")
        if (lyTreeLists.title == "固定")
            ztreecontent.style.display = 'none';
    }
}
layerBar_position.appendChild(layerbar_data);
//名称
var layerbar_data_text = document.createElement("span");
layerbar_data_text.innerText = "图层";
layerbar_data.appendChild(layerbar_data_text);

///数据操作
//数据操作容器
var layerbar_layer = document.createElement("div");
layerbar_layer.className = "layerbar-main-form-data";
//layerBar_position.appendChild(layerbar_layer);
layerbar_layer.onclick = function() {
        var lyId = layerOperateId;
        var lyOperateBar = document.getElementById(lyId);
        if (lyOperateBar) {
            if (lyOperateBar.style.display == "none") {
                lyOperateBar.style.display = '';
                $("#" + layerTreeId).hide();
            } else
                lyOperateBar.style.display = 'none';
        }

    }
    //名称
var layerbar_layer_text = document.createElement("span");
layerbar_layer_text.innerText = "数据";
layerbar_layer.appendChild(layerbar_layer_text);


//创建主窗体div
function createWidgetMainForm(id) {
    var lyWidget = document.createElement('div');
    lyWidget.id = id;
    document.body.appendChild(lyWidget);

    var lyScrollBox = document.createElement('div');
    lyScrollBox.className = "LayerTree-main-form-scrollbox";
    lyWidget.appendChild(lyScrollBox);

    var analysisPanel = document.createElement("div"); //
    analysisPanel.id = "LayerTree-main-form-panel";
    analysisPanel.className = "LayerTree-main-form-panel";
    //analysisPanel.style = "margin-top:0px;";
    lyScrollBox.appendChild(analysisPanel);
    return analysisPanel;
}